<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>添加/编辑菜单 - Powered By ${systemConfig.systemName}</title>
<meta name="Author" content="SHOP++ Team" />
<meta name="Copyright" content="SHOP++" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<#include "/WEB-INF/template/common/include.ftl">
<link href="${base}/template/admin/css/input.css" rel="stylesheet" type="text/css" />
<#if !id??>
	<#assign isAdd = true />
<#else>
	<#assign isEdit = true />
</#if>
</head>
<body class="input">
	<div class="body">
		<div class="inputBar">
			<h1><span class="icon">&nbsp;</span><#if isAdd??>添加菜单<#else>编辑菜单</#if></h1>
		</div>
		<form id="inputForm" class="validate" action="<#if isAdd??>menu!save.action<#else>menu!update.action</#if>" method="post">
			<input type="hidden" name="id" value="${id}" />
			<ul class="tab">
				<li>
					<input type="button" value="基本信息" hidefocus="true" />
				</li>
			</ul>
			<table class="inputTable tabContent">
				<tr>
					<th>
						菜单名称:
					</th>
					<td>
						<input type="text" name="menu.name" class="formText {required: true}" value="${(menu.name)!}" />
						<label class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						上级菜单:
					</th>
					<td>
						<#if isAdd??>
							<select name="parentId">
								<option value="">顶级菜单</option>
								<#list menuTreeList as list>
									<option value="${list.id}">
										<#if list.level != 0>
											<#list 1..list.level as i>------</#list>
										</#if>
									${list.name}
									</option>
								</#list>
							</select>
						<#else>
						<select name="parentId">
								<option value="">顶级菜单</option>
								<#list menuTreeList as list>
									<option value="${list.id}" <#if null!=menu.parent&&list.id==menu.parent.id>selected</#if>>
										<#if list.level != 0>
											<#list 1..list.level as i>------</#list>
										</#if>
									${list.name}
									</option>
								</#list>
							</select>
							当前上级菜单：<red>${(menu.parent.name)!'顶级菜单'}</red>
						</#if>
					</td>
				</tr>

				<tr>
					<th>
						路径:
					</th>
					<td>
						<input type="text" name="menu.url" class="formText" value="${(menu.url)!}" />
					</td>
				</tr>
				<tr>
					<th>
						链接打开窗口:
					</th>
					<td>
						<input type="text" name="menu.frame" class="formText" value="${(menu.frame)!}" />
					</td>
				</tr>
				<tr>
					<th>
						排序:
					</th>
					<td>
						<input type="text" name="menu.orderList" class="formText {required: true, digits: true}" value="${(menu.orderList)!50}" title="只允许输入零或正整数" />
						<label class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						是否有链接:
					</th>
					<td>
						<label><input type="radio" name="menu.isAction" value="true"<#if (isAdd || menu.isAction == true)!> checked</#if> />是</label>
						<label><input type="radio" name="menu.isAction" value="false"<#if (menu.isAction == false)!> checked</#if> />否</label>
					</td>
				</tr>
			</table>
			<div class="buttonArea">
				<input type="submit" class="formButton" value="确  定" hidefocus="true" />&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" class="formButton" onclick="window.history.back(); return false;" value="返  回" hidefocus="true" />
			</div>
		</form>
	</div>
</body>
</html>